Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions hal/api/SingletonPtr.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ struct SingletonPtr {
* @returns
* A pointer to the singleton
*/
T* get() {
T* get() const {
if (NULL == _ptr) {
singleton_lock();
if (NULL == _ptr) {
Expand All @@ -92,14 +92,14 @@ struct SingletonPtr {
* @returns
* A pointer to the singleton
*/
T* operator->() {
T* operator->() const {
return get();
}

// This is zero initialized when in global scope
T *_ptr;
mutable T * _ptr;
// Force data to be 4 byte aligned
uint32_t _data[(sizeof(T) + sizeof(uint32_t) - 1) / sizeof(uint32_t)];
mutable uint32_t _data[(sizeof(T) + sizeof(uint32_t) - 1) / sizeof(uint32_t)];
};

#endif