145 | 505 | } _Z5AllocI6Tuple2IP6BigStriEJS2_iEEPT_DpOT0_ Line | Count | Source | 108 | 5 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 5 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 5 | "Expected no padding"); | 121 | | | 122 | 5 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 5 | #if MARK_SWEEP | 126 | 5 | int obj_id; | 127 | 5 | int pool_id; | 128 | 5 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 5 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 5 | #if MARK_SWEEP | 134 | 5 | header->obj_id = obj_id; | 135 | 5 | #ifndef NO_POOL_ALLOC | 136 | 5 | header->pool_id = pool_id; | 137 | 5 | #endif | 138 | 5 | #endif | 139 | 5 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 5 | memset(obj, 0, sizeof(T)); | 144 | 5 | return new (obj) T(std::forward<Args>(args)...); | 145 | 5 | } |
_Z5AllocI4DictIP5PointP6BigStrEJEEPT_DpOT0_ Line | Count | Source | 108 | 1 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 1 | "Expected no padding"); | 121 | | | 122 | 1 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 1 | #if MARK_SWEEP | 126 | 1 | int obj_id; | 127 | 1 | int pool_id; | 128 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 1 | #if MARK_SWEEP | 134 | 1 | header->obj_id = obj_id; | 135 | 1 | #ifndef NO_POOL_ALLOC | 136 | 1 | header->pool_id = pool_id; | 137 | 1 | #endif | 138 | 1 | #endif | 139 | 1 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 1 | memset(obj, 0, sizeof(T)); | 144 | 1 | return new (obj) T(std::forward<Args>(args)...); | 145 | 1 | } |
_Z5AllocI5PointJiiEEPT_DpOT0_ Line | Count | Source | 108 | 34 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 34 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 34 | "Expected no padding"); | 121 | | | 122 | 34 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 34 | #if MARK_SWEEP | 126 | 34 | int obj_id; | 127 | 34 | int pool_id; | 128 | 34 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 34 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 34 | #if MARK_SWEEP | 134 | 34 | header->obj_id = obj_id; | 135 | 34 | #ifndef NO_POOL_ALLOC | 136 | 34 | header->pool_id = pool_id; | 137 | 34 | #endif | 138 | 34 | #endif | 139 | 34 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 34 | memset(obj, 0, sizeof(T)); | 144 | 34 | return new (obj) T(std::forward<Args>(args)...); | 145 | 34 | } |
_Z5AllocI4DictIiP6BigStrEJEEPT_DpOT0_ Line | Count | Source | 108 | 5 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 5 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 5 | "Expected no padding"); | 121 | | | 122 | 5 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 5 | #if MARK_SWEEP | 126 | 5 | int obj_id; | 127 | 5 | int pool_id; | 128 | 5 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 5 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 5 | #if MARK_SWEEP | 134 | 5 | header->obj_id = obj_id; | 135 | 5 | #ifndef NO_POOL_ALLOC | 136 | 5 | header->pool_id = pool_id; | 137 | 5 | #endif | 138 | 5 | #endif | 139 | 5 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 5 | memset(obj, 0, sizeof(T)); | 144 | 5 | return new (obj) T(std::forward<Args>(args)...); | 145 | 5 | } |
_Z5AllocI4ListIiEJEEPT_DpOT0_ Line | Count | Source | 108 | 334 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 334 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 334 | "Expected no padding"); | 121 | | | 122 | 334 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 334 | #if MARK_SWEEP | 126 | 334 | int obj_id; | 127 | 334 | int pool_id; | 128 | 334 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 334 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 334 | #if MARK_SWEEP | 134 | 334 | header->obj_id = obj_id; | 135 | 334 | #ifndef NO_POOL_ALLOC | 136 | 334 | header->pool_id = pool_id; | 137 | 334 | #endif | 138 | 334 | #endif | 139 | 334 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 334 | memset(obj, 0, sizeof(T)); | 144 | 334 | return new (obj) T(std::forward<Args>(args)...); | 145 | 334 | } |
_Z5AllocI10IndexErrorJEEPT_DpOT0_ Line | Count | Source | 108 | 5 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 5 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 5 | "Expected no padding"); | 121 | | | 122 | 5 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 5 | #if MARK_SWEEP | 126 | 5 | int obj_id; | 127 | 5 | int pool_id; | 128 | 5 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 5 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 5 | #if MARK_SWEEP | 134 | 5 | header->obj_id = obj_id; | 135 | 5 | #ifndef NO_POOL_ALLOC | 136 | 5 | header->pool_id = pool_id; | 137 | 5 | #endif | 138 | 5 | #endif | 139 | 5 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 5 | memset(obj, 0, sizeof(T)); | 144 | 5 | return new (obj) T(std::forward<Args>(args)...); | 145 | 5 | } |
_Z5AllocI4DictIlP6BigStrEJEEPT_DpOT0_ Line | Count | Source | 108 | 2 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 2 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 2 | "Expected no padding"); | 121 | | | 122 | 2 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 2 | #if MARK_SWEEP | 126 | 2 | int obj_id; | 127 | 2 | int pool_id; | 128 | 2 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 2 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 2 | #if MARK_SWEEP | 134 | 2 | header->obj_id = obj_id; | 135 | 2 | #ifndef NO_POOL_ALLOC | 136 | 2 | header->pool_id = pool_id; | 137 | 2 | #endif | 138 | 2 | #endif | 139 | 2 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 2 | memset(obj, 0, sizeof(T)); | 144 | 2 | return new (obj) T(std::forward<Args>(args)...); | 145 | 2 | } |
_Z5AllocI4ListIlEJEEPT_DpOT0_ Line | Count | Source | 108 | 1 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 1 | "Expected no padding"); | 121 | | | 122 | 1 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 1 | #if MARK_SWEEP | 126 | 1 | int obj_id; | 127 | 1 | int pool_id; | 128 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 1 | #if MARK_SWEEP | 134 | 1 | header->obj_id = obj_id; | 135 | 1 | #ifndef NO_POOL_ALLOC | 136 | 1 | header->pool_id = pool_id; | 137 | 1 | #endif | 138 | 1 | #endif | 139 | 1 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 1 | memset(obj, 0, sizeof(T)); | 144 | 1 | return new (obj) T(std::forward<Args>(args)...); | 145 | 1 | } |
_Z5AllocI10ValueErrorJEEPT_DpOT0_ Line | Count | Source | 108 | 7 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 7 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 7 | "Expected no padding"); | 121 | | | 122 | 7 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 7 | #if MARK_SWEEP | 126 | 7 | int obj_id; | 127 | 7 | int pool_id; | 128 | 7 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 7 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 7 | #if MARK_SWEEP | 134 | 7 | header->obj_id = obj_id; | 135 | 7 | #ifndef NO_POOL_ALLOC | 136 | 7 | header->pool_id = pool_id; | 137 | 7 | #endif | 138 | 7 | #endif | 139 | 7 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 7 | memset(obj, 0, sizeof(T)); | 144 | 7 | return new (obj) T(std::forward<Args>(args)...); | 145 | 7 | } |
_Z5AllocI10ValueErrorJRP6BigStrEEPT_DpOT0_ Line | Count | Source | 108 | 1 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 1 | "Expected no padding"); | 121 | | | 122 | 1 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 1 | #if MARK_SWEEP | 126 | 1 | int obj_id; | 127 | 1 | int pool_id; | 128 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 1 | #if MARK_SWEEP | 134 | 1 | header->obj_id = obj_id; | 135 | 1 | #ifndef NO_POOL_ALLOC | 136 | 1 | header->pool_id = pool_id; | 137 | 1 | #endif | 138 | 1 | #endif | 139 | 1 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 1 | memset(obj, 0, sizeof(T)); | 144 | 1 | return new (obj) T(std::forward<Args>(args)...); | 145 | 1 | } |
_Z5AllocI7OSErrorJiEEPT_DpOT0_ Line | Count | Source | 108 | 1 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 1 | "Expected no padding"); | 121 | | | 122 | 1 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 1 | #if MARK_SWEEP | 126 | 1 | int obj_id; | 127 | 1 | int pool_id; | 128 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 1 | #if MARK_SWEEP | 134 | 1 | header->obj_id = obj_id; | 135 | 1 | #ifndef NO_POOL_ALLOC | 136 | 1 | header->pool_id = pool_id; | 137 | 1 | #endif | 138 | 1 | #endif | 139 | 1 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 1 | memset(obj, 0, sizeof(T)); | 144 | 1 | return new (obj) T(std::forward<Args>(args)...); | 145 | 1 | } |
_Z5AllocI12RuntimeErrorJRP6BigStrEEPT_DpOT0_ Line | Count | Source | 108 | 1 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 1 | "Expected no padding"); | 121 | | | 122 | 1 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 1 | #if MARK_SWEEP | 126 | 1 | int obj_id; | 127 | 1 | int pool_id; | 128 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 1 | #if MARK_SWEEP | 134 | 1 | header->obj_id = obj_id; | 135 | 1 | #ifndef NO_POOL_ALLOC | 136 | 1 | header->pool_id = pool_id; | 137 | 1 | #endif | 138 | 1 | #endif | 139 | 1 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 1 | memset(obj, 0, sizeof(T)); | 144 | 1 | return new (obj) T(std::forward<Args>(args)...); | 145 | 1 | } |
_Z5AllocI12UnicodeErrorJP6BigStrEEPT_DpOT0_ Line | Count | Source | 108 | 1 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 1 | "Expected no padding"); | 121 | | | 122 | 1 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 1 | #if MARK_SWEEP | 126 | 1 | int obj_id; | 127 | 1 | int pool_id; | 128 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 1 | #if MARK_SWEEP | 134 | 1 | header->obj_id = obj_id; | 135 | 1 | #ifndef NO_POOL_ALLOC | 136 | 1 | header->pool_id = pool_id; | 137 | 1 | #endif | 138 | 1 | #endif | 139 | 1 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 1 | memset(obj, 0, sizeof(T)); | 144 | 1 | return new (obj) T(std::forward<Args>(args)...); | 145 | 1 | } |
_Z5AllocI7IOErrorJiEEPT_DpOT0_ Line | Count | Source | 108 | 1 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 1 | "Expected no padding"); | 121 | | | 122 | 1 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 1 | #if MARK_SWEEP | 126 | 1 | int obj_id; | 127 | 1 | int pool_id; | 128 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 1 | #if MARK_SWEEP | 134 | 1 | header->obj_id = obj_id; | 135 | 1 | #ifndef NO_POOL_ALLOC | 136 | 1 | header->pool_id = pool_id; | 137 | 1 | #endif | 138 | 1 | #endif | 139 | 1 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 1 | memset(obj, 0, sizeof(T)); | 144 | 1 | return new (obj) T(std::forward<Args>(args)...); | 145 | 1 | } |
_Z5AllocIN5mylib5CFileEJRP8_IO_FILEEEPT_DpOT0_ Line | Count | Source | 108 | 7 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 7 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 7 | "Expected no padding"); | 121 | | | 122 | 7 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 7 | #if MARK_SWEEP | 126 | 7 | int obj_id; | 127 | 7 | int pool_id; | 128 | 7 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 7 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 7 | #if MARK_SWEEP | 134 | 7 | header->obj_id = obj_id; | 135 | 7 | #ifndef NO_POOL_ALLOC | 136 | 7 | header->pool_id = pool_id; | 137 | 7 | #endif | 138 | 7 | #endif | 139 | 7 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 7 | memset(obj, 0, sizeof(T)); | 144 | 7 | return new (obj) T(std::forward<Args>(args)...); | 145 | 7 | } |
_Z5AllocIN5iolib10SignalSafeEJEEPT_DpOT0_ Line | Count | Source | 108 | 1 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 1 | "Expected no padding"); | 121 | | | 122 | 1 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 1 | #if MARK_SWEEP | 126 | 1 | int obj_id; | 127 | 1 | int pool_id; | 128 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 1 | #if MARK_SWEEP | 134 | 1 | header->obj_id = obj_id; | 135 | 1 | #ifndef NO_POOL_ALLOC | 136 | 1 | header->pool_id = pool_id; | 137 | 1 | #endif | 138 | 1 | #endif | 139 | 1 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 1 | memset(obj, 0, sizeof(T)); | 144 | 1 | return new (obj) T(std::forward<Args>(args)...); | 145 | 1 | } |
Unexecuted instantiation: _Z5AllocI7OSErrorJRiEEPT_DpOT0_ Unexecuted instantiation: _Z5AllocI7IOErrorJRiEEPT_DpOT0_ Unexecuted instantiation: _Z5AllocI17KeyboardInterruptJEEPT_DpOT0_ _Z5AllocI4ListIP6BigStrEJEEPT_DpOT0_ Line | Count | Source | 108 | 46 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 46 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 46 | "Expected no padding"); | 121 | | | 122 | 46 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 46 | #if MARK_SWEEP | 126 | 46 | int obj_id; | 127 | 46 | int pool_id; | 128 | 46 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 46 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 46 | #if MARK_SWEEP | 134 | 46 | header->obj_id = obj_id; | 135 | 46 | #ifndef NO_POOL_ALLOC | 136 | 46 | header->pool_id = pool_id; | 137 | 46 | #endif | 138 | 46 | #endif | 139 | 46 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 46 | memset(obj, 0, sizeof(T)); | 144 | 46 | return new (obj) T(std::forward<Args>(args)...); | 145 | 46 | } |
_Z5AllocI4DictIiP6BigStrEJSt16initializer_listIiES4_IS2_EEEPT_DpOT0_ Line | Count | Source | 108 | 1 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 1 | "Expected no padding"); | 121 | | | 122 | 1 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 1 | #if MARK_SWEEP | 126 | 1 | int obj_id; | 127 | 1 | int pool_id; | 128 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 1 | #if MARK_SWEEP | 134 | 1 | header->obj_id = obj_id; | 135 | 1 | #ifndef NO_POOL_ALLOC | 136 | 1 | header->pool_id = pool_id; | 137 | 1 | #endif | 138 | 1 | #endif | 139 | 1 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 1 | memset(obj, 0, sizeof(T)); | 144 | 1 | return new (obj) T(std::forward<Args>(args)...); | 145 | 1 | } |
Unexecuted instantiation: _Z5AllocI8KeyErrorJEEPT_DpOT0_ _Z5AllocI4DictIP6BigStriEJSt16initializer_listIS2_ES4_IiEEEPT_DpOT0_ Line | Count | Source | 108 | 1 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 1 | "Expected no padding"); | 121 | | | 122 | 1 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 1 | #if MARK_SWEEP | 126 | 1 | int obj_id; | 127 | 1 | int pool_id; | 128 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 1 | #if MARK_SWEEP | 134 | 1 | header->obj_id = obj_id; | 135 | 1 | #ifndef NO_POOL_ALLOC | 136 | 1 | header->pool_id = pool_id; | 137 | 1 | #endif | 138 | 1 | #endif | 139 | 1 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 1 | memset(obj, 0, sizeof(T)); | 144 | 1 | return new (obj) T(std::forward<Args>(args)...); | 145 | 1 | } |
_Z5AllocI4DictIP6BigStriEJEEPT_DpOT0_ Line | Count | Source | 108 | 8 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 8 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 8 | "Expected no padding"); | 121 | | | 122 | 8 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 8 | #if MARK_SWEEP | 126 | 8 | int obj_id; | 127 | 8 | int pool_id; | 128 | 8 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 8 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 8 | #if MARK_SWEEP | 134 | 8 | header->obj_id = obj_id; | 135 | 8 | #ifndef NO_POOL_ALLOC | 136 | 8 | header->pool_id = pool_id; | 137 | 8 | #endif | 138 | 8 | #endif | 139 | 8 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 8 | memset(obj, 0, sizeof(T)); | 144 | 8 | return new (obj) T(std::forward<Args>(args)...); | 145 | 8 | } |
_Z5AllocI4DictIP6BigStrS2_EJEEPT_DpOT0_ Line | Count | Source | 108 | 3 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 3 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 3 | "Expected no padding"); | 121 | | | 122 | 3 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 3 | #if MARK_SWEEP | 126 | 3 | int obj_id; | 127 | 3 | int pool_id; | 128 | 3 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 3 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 3 | #if MARK_SWEEP | 134 | 3 | header->obj_id = obj_id; | 135 | 3 | #ifndef NO_POOL_ALLOC | 136 | 3 | header->pool_id = pool_id; | 137 | 3 | #endif | 138 | 3 | #endif | 139 | 3 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 3 | memset(obj, 0, sizeof(T)); | 144 | 3 | return new (obj) T(std::forward<Args>(args)...); | 145 | 3 | } |
_Z5AllocI4DictIiiEJEEPT_DpOT0_ Line | Count | Source | 108 | 8 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 8 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 8 | "Expected no padding"); | 121 | | | 122 | 8 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 8 | #if MARK_SWEEP | 126 | 8 | int obj_id; | 127 | 8 | int pool_id; | 128 | 8 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 8 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 8 | #if MARK_SWEEP | 134 | 8 | header->obj_id = obj_id; | 135 | 8 | #ifndef NO_POOL_ALLOC | 136 | 8 | header->pool_id = pool_id; | 137 | 8 | #endif | 138 | 8 | #endif | 139 | 8 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 8 | memset(obj, 0, sizeof(T)); | 144 | 8 | return new (obj) T(std::forward<Args>(args)...); | 145 | 8 | } |
_Z5AllocI4ListIP6Tuple2IiiEEJEEPT_DpOT0_ Line | Count | Source | 108 | 2 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 2 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 2 | "Expected no padding"); | 121 | | | 122 | 2 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 2 | #if MARK_SWEEP | 126 | 2 | int obj_id; | 127 | 2 | int pool_id; | 128 | 2 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 2 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 2 | #if MARK_SWEEP | 134 | 2 | header->obj_id = obj_id; | 135 | 2 | #ifndef NO_POOL_ALLOC | 136 | 2 | header->pool_id = pool_id; | 137 | 2 | #endif | 138 | 2 | #endif | 139 | 2 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 2 | memset(obj, 0, sizeof(T)); | 144 | 2 | return new (obj) T(std::forward<Args>(args)...); | 145 | 2 | } |
_Z5AllocI6Tuple2IiiEJiiEEPT_DpOT0_ Line | Count | Source | 108 | 8 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 8 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 8 | "Expected no padding"); | 121 | | | 122 | 8 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 8 | #if MARK_SWEEP | 126 | 8 | int obj_id; | 127 | 8 | int pool_id; | 128 | 8 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 8 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 8 | #if MARK_SWEEP | 134 | 8 | header->obj_id = obj_id; | 135 | 8 | #ifndef NO_POOL_ALLOC | 136 | 8 | header->pool_id = pool_id; | 137 | 8 | #endif | 138 | 8 | #endif | 139 | 8 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 8 | memset(obj, 0, sizeof(T)); | 144 | 8 | return new (obj) T(std::forward<Args>(args)...); | 145 | 8 | } |
_Z5AllocI4DictIP6Tuple2IiiEiEJEEPT_DpOT0_ Line | Count | Source | 108 | 1 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 1 | "Expected no padding"); | 121 | | | 122 | 1 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 1 | #if MARK_SWEEP | 126 | 1 | int obj_id; | 127 | 1 | int pool_id; | 128 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 1 | #if MARK_SWEEP | 134 | 1 | header->obj_id = obj_id; | 135 | 1 | #ifndef NO_POOL_ALLOC | 136 | 1 | header->pool_id = pool_id; | 137 | 1 | #endif | 138 | 1 | #endif | 139 | 1 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 1 | memset(obj, 0, sizeof(T)); | 144 | 1 | return new (obj) T(std::forward<Args>(args)...); | 145 | 1 | } |
_Z5AllocI4DictIP6Tuple2IP6BigStriEiEJEEPT_DpOT0_ Line | Count | Source | 108 | 1 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 1 | "Expected no padding"); | 121 | | | 122 | 1 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 1 | #if MARK_SWEEP | 126 | 1 | int obj_id; | 127 | 1 | int pool_id; | 128 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 1 | #if MARK_SWEEP | 134 | 1 | header->obj_id = obj_id; | 135 | 1 | #ifndef NO_POOL_ALLOC | 136 | 1 | header->pool_id = pool_id; | 137 | 1 | #endif | 138 | 1 | #endif | 139 | 1 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 1 | memset(obj, 0, sizeof(T)); | 144 | 1 | return new (obj) T(std::forward<Args>(args)...); | 145 | 1 | } |
_Z5AllocI4LineJEEPT_DpOT0_ Line | Count | Source | 108 | 1 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 1 | "Expected no padding"); | 121 | | | 122 | 1 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 1 | #if MARK_SWEEP | 126 | 1 | int obj_id; | 127 | 1 | int pool_id; | 128 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 1 | #if MARK_SWEEP | 134 | 1 | header->obj_id = obj_id; | 135 | 1 | #ifndef NO_POOL_ALLOC | 136 | 1 | header->pool_id = pool_id; | 137 | 1 | #endif | 138 | 1 | #endif | 139 | 1 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 1 | memset(obj, 0, sizeof(T)); | 144 | 1 | return new (obj) T(std::forward<Args>(args)...); | 145 | 1 | } |
_Z5AllocI10DerivedObjJEEPT_DpOT0_ Line | Count | Source | 108 | 1 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 1 | "Expected no padding"); | 121 | | | 122 | 1 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 1 | #if MARK_SWEEP | 126 | 1 | int obj_id; | 127 | 1 | int pool_id; | 128 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 1 | #if MARK_SWEEP | 134 | 1 | header->obj_id = obj_id; | 135 | 1 | #ifndef NO_POOL_ALLOC | 136 | 1 | header->pool_id = pool_id; | 137 | 1 | #endif | 138 | 1 | #endif | 139 | 1 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 1 | memset(obj, 0, sizeof(T)); | 144 | 1 | return new (obj) T(std::forward<Args>(args)...); | 145 | 1 | } |
_Z5AllocI4ListIbEJEEPT_DpOT0_ Line | Count | Source | 108 | 1 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 1 | "Expected no padding"); | 121 | | | 122 | 1 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 1 | #if MARK_SWEEP | 126 | 1 | int obj_id; | 127 | 1 | int pool_id; | 128 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 1 | #if MARK_SWEEP | 134 | 1 | header->obj_id = obj_id; | 135 | 1 | #ifndef NO_POOL_ALLOC | 136 | 1 | header->pool_id = pool_id; | 137 | 1 | #endif | 138 | 1 | #endif | 139 | 1 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 1 | memset(obj, 0, sizeof(T)); | 144 | 1 | return new (obj) T(std::forward<Args>(args)...); | 145 | 1 | } |
_Z5AllocI4ListIPiEJEEPT_DpOT0_ Line | Count | Source | 108 | 1 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 1 | "Expected no padding"); | 121 | | | 122 | 1 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 1 | #if MARK_SWEEP | 126 | 1 | int obj_id; | 127 | 1 | int pool_id; | 128 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 1 | #if MARK_SWEEP | 134 | 1 | header->obj_id = obj_id; | 135 | 1 | #ifndef NO_POOL_ALLOC | 136 | 1 | header->pool_id = pool_id; | 137 | 1 | #endif | 138 | 1 | #endif | 139 | 1 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 1 | memset(obj, 0, sizeof(T)); | 144 | 1 | return new (obj) T(std::forward<Args>(args)...); | 145 | 1 | } |
_Z5AllocIN5mylib9BufWriterEJEEPT_DpOT0_ Line | Count | Source | 108 | 4 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 4 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 4 | "Expected no padding"); | 121 | | | 122 | 4 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 4 | #if MARK_SWEEP | 126 | 4 | int obj_id; | 127 | 4 | int pool_id; | 128 | 4 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 4 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 4 | #if MARK_SWEEP | 134 | 4 | header->obj_id = obj_id; | 135 | 4 | #ifndef NO_POOL_ALLOC | 136 | 4 | header->pool_id = pool_id; | 137 | 4 | #endif | 138 | 4 | #endif | 139 | 4 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 4 | memset(obj, 0, sizeof(T)); | 144 | 4 | return new (obj) T(std::forward<Args>(args)...); | 145 | 4 | } |
_Z5AllocIN5mylib13BufLineReaderEJRP6BigStrEEPT_DpOT0_ Line | Count | Source | 108 | 3 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 3 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 3 | "Expected no padding"); | 121 | | | 122 | 3 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 3 | #if MARK_SWEEP | 126 | 3 | int obj_id; | 127 | 3 | int pool_id; | 128 | 3 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 3 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 3 | #if MARK_SWEEP | 134 | 3 | header->obj_id = obj_id; | 135 | 3 | #ifndef NO_POOL_ALLOC | 136 | 3 | header->pool_id = pool_id; | 137 | 3 | #endif | 138 | 3 | #endif | 139 | 3 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 3 | memset(obj, 0, sizeof(T)); | 144 | 3 | return new (obj) T(std::forward<Args>(args)...); | 145 | 3 | } |
_Z5AllocI6Tuple2IiP6BigStrEJiS2_EEPT_DpOT0_ Line | Count | Source | 108 | 1 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 1 | "Expected no padding"); | 121 | | | 122 | 1 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 1 | #if MARK_SWEEP | 126 | 1 | int obj_id; | 127 | 1 | int pool_id; | 128 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 1 | #if MARK_SWEEP | 134 | 1 | header->obj_id = obj_id; | 135 | 1 | #ifndef NO_POOL_ALLOC | 136 | 1 | header->pool_id = pool_id; | 137 | 1 | #endif | 138 | 1 | #endif | 139 | 1 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 1 | memset(obj, 0, sizeof(T)); | 144 | 1 | return new (obj) T(std::forward<Args>(args)...); | 145 | 1 | } |
_Z5AllocI6Tuple3IiP6BigStrS2_EJiS2_S2_EEPT_DpOT0_ Line | Count | Source | 108 | 1 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 1 | "Expected no padding"); | 121 | | | 122 | 1 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 1 | #if MARK_SWEEP | 126 | 1 | int obj_id; | 127 | 1 | int pool_id; | 128 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 1 | #if MARK_SWEEP | 134 | 1 | header->obj_id = obj_id; | 135 | 1 | #ifndef NO_POOL_ALLOC | 136 | 1 | header->pool_id = pool_id; | 137 | 1 | #endif | 138 | 1 | #endif | 139 | 1 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 1 | memset(obj, 0, sizeof(T)); | 144 | 1 | return new (obj) T(std::forward<Args>(args)...); | 145 | 1 | } |
_Z5AllocI6Tuple4IiP6BigStrS2_iEJiS2_S2_iEEPT_DpOT0_ Line | Count | Source | 108 | 1 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 1 | "Expected no padding"); | 121 | | | 122 | 1 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 1 | #if MARK_SWEEP | 126 | 1 | int obj_id; | 127 | 1 | int pool_id; | 128 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 1 | #if MARK_SWEEP | 134 | 1 | header->obj_id = obj_id; | 135 | 1 | #ifndef NO_POOL_ALLOC | 136 | 1 | header->pool_id = pool_id; | 137 | 1 | #endif | 138 | 1 | #endif | 139 | 1 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 1 | memset(obj, 0, sizeof(T)); | 144 | 1 | return new (obj) T(std::forward<Args>(args)...); | 145 | 1 | } |
_Z5AllocI6Tuple2IiP6BigStrEJiRS2_EEPT_DpOT0_ Line | Count | Source | 108 | 2 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 2 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 2 | "Expected no padding"); | 121 | | | 122 | 2 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 2 | #if MARK_SWEEP | 126 | 2 | int obj_id; | 127 | 2 | int pool_id; | 128 | 2 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 2 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 2 | #if MARK_SWEEP | 134 | 2 | header->obj_id = obj_id; | 135 | 2 | #ifndef NO_POOL_ALLOC | 136 | 2 | header->pool_id = pool_id; | 137 | 2 | #endif | 138 | 2 | #endif | 139 | 2 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 2 | memset(obj, 0, sizeof(T)); | 144 | 2 | return new (obj) T(std::forward<Args>(args)...); | 145 | 2 | } |
_Z5AllocI6Tuple2IiPS0_IiP6BigStrEEJiRS4_EEPT_DpOT0_ Line | Count | Source | 108 | 1 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 1 | "Expected no padding"); | 121 | | | 122 | 1 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 1 | #if MARK_SWEEP | 126 | 1 | int obj_id; | 127 | 1 | int pool_id; | 128 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 1 | #if MARK_SWEEP | 134 | 1 | header->obj_id = obj_id; | 135 | 1 | #ifndef NO_POOL_ALLOC | 136 | 1 | header->pool_id = pool_id; | 137 | 1 | #endif | 138 | 1 | #endif | 139 | 1 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 1 | memset(obj, 0, sizeof(T)); | 144 | 1 | return new (obj) T(std::forward<Args>(args)...); | 145 | 1 | } |
_Z5AllocI4NodeJEEPT_DpOT0_ Line | Count | Source | 108 | 2 | T* Alloc(Args&&... args) { | 109 | | // Alloc() allocates space for both a header and object and guarantees that | 110 | | // they're adjacent in memory (so that they're at known offsets from one | 111 | | // another). However, this means that the address that the object is | 112 | | // constructed at is offset from the address returned by the memory allocator | 113 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 114 | | // Here we assert that the object will be sufficiently aligned by making the | 115 | | // equivalent assertion that zero padding would be required to align it. | 116 | | // Note: the required padding is given by the following (according to | 117 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 118 | | // `padding = -offset & (align - 1)`. | 119 | 2 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 120 | 2 | "Expected no padding"); | 121 | | | 122 | 2 | DCHECK(gHeap.is_initialized_); | 123 | | | 124 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 125 | 2 | #if MARK_SWEEP | 126 | 2 | int obj_id; | 127 | 2 | int pool_id; | 128 | 2 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 129 | | #else | 130 | | void* place = gHeap.Allocate(num_bytes); | 131 | | #endif | 132 | 2 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 133 | 2 | #if MARK_SWEEP | 134 | 2 | header->obj_id = obj_id; | 135 | 2 | #ifndef NO_POOL_ALLOC | 136 | 2 | header->pool_id = pool_id; | 137 | 2 | #endif | 138 | 2 | #endif | 139 | 2 | void* obj = header->ObjectAddress(); | 140 | | // Now that mycpp generates code to initialize every field, we should | 141 | | // get rid of this. | 142 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 143 | 2 | memset(obj, 0, sizeof(T)); | 144 | 2 | return new (obj) T(std::forward<Args>(args)...); | 145 | 2 | } |
|