[gjs: 1/12] Remove comments referring to the slice allocator
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs: 1/12] Remove comments referring to the slice allocator
- Date: Fri, 5 Mar 2021 05:05:09 +0000 (UTC)
commit a7be3f9113868e7e71a1362cdb7446d577e9ad8c
Author: Philip Chimento <philip chimento gmail com>
Date: Sat Feb 13 11:52:55 2021 -0800
Remove comments referring to the slice allocator
We no longer use the slice allocator.
gi/boxed.cpp | 18 +++++++++---------
gi/wrapperutils.h | 2 +-
2 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/gi/boxed.cpp b/gi/boxed.cpp
index 7214aa07..83feb2a2 100644
--- a/gi/boxed.cpp
+++ b/gi/boxed.cpp
@@ -342,15 +342,15 @@ bool BoxedInstance::constructor_impl(JSContext* context, JS::HandleObject obj,
BoxedPrototype* proto = get_prototype();
- /* If the structure is registered as a boxed, we can create a new instance by
- * looking for a zero-args constructor and calling it.
- * Constructors don't really make sense for non-boxed types, since there is no
- * memory management for the return value, and zero_args_constructor and
- * default_constructor are always -1 for them.
- *
- * For backward compatibility, we choose the zero args constructor if one
- * exists, otherwise we choose the internal slice allocator if possible;
- * finally, we fallback on the default constructor */
+ // If the structure is registered as a boxed, we can create a new instance
+ // by looking for a zero-args constructor and calling it.
+ // Constructors don't really make sense for non-boxed types, since there is
+ // no memory management for the return value, and zero_args_constructor and
+ // default_constructor are always -1 for them.
+ //
+ // For backward compatibility, we choose the zero args constructor if one
+ // exists, otherwise we malloc the correct amount of space if possible;
+ // finally, we fallback on the default constructor.
if (proto->has_zero_args_constructor()) {
GjsAutoFunctionInfo func_info = proto->zero_args_constructor_info();
diff --git a/gi/wrapperutils.h b/gi/wrapperutils.h
index d202f63e..1057149d 100644
--- a/gi/wrapperutils.h
+++ b/gi/wrapperutils.h
@@ -952,7 +952,7 @@ class GIWrapperInstance : public Base {
* GIWrapperInstance::new_for_js_object:
*
* Creates a GIWrapperInstance and associates it with @obj as its private
- * data. This is called by the JS constructor. Uses the slice allocator.
+ * data. This is called by the JS constructor.
*/
[[nodiscard]] static Instance* new_for_js_object(JSContext* cx,
JS::HandleObject obj) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]