Initialize this value as array with initial data, without calling destructor.
| 1974 | |
| 1975 | // Initialize this value as array with initial data, without calling destructor. |
| 1976 | void SetArrayRaw(GenericValue* values, SizeType count, Allocator& allocator) { |
| 1977 | data_.f.flags = kArrayFlag; |
| 1978 | if (count) { |
| 1979 | GenericValue* e = static_cast<GenericValue*>(allocator.Malloc(count * sizeof(GenericValue))); |
| 1980 | SetElementsPointer(e); |
| 1981 | std::memcpy(e, values, count * sizeof(GenericValue)); |
| 1982 | } |
| 1983 | else |
| 1984 | SetElementsPointer(0); |
| 1985 | data_.a.size = data_.a.capacity = count; |
| 1986 | } |
| 1987 | |
| 1988 | //! Initialize this value as object with initial data, without calling destructor. |
| 1989 | void SetObjectRaw(Member* members, SizeType count, Allocator& allocator) { |