Skip to content

Commit

Permalink
Use size_t for xr_alloc()
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Jan 6, 2018
1 parent d4cf071 commit 06fa47c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/xrCore/Memory/xalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class xalloc
xalloc(const xalloc<_Other>&) {}
template<class _Other>
xalloc<T>& operator=(const xalloc<_Other>&) { return *this; }
pointer allocate(size_type n, const void* p = nullptr) const { return xr_alloc<T>((u32)n); }
pointer allocate(size_type n, const void* p = nullptr) const { return xr_alloc<T>(n); }
char* _charalloc(size_type n) { return (char*)allocate(n); }
void deallocate(pointer p, size_type n) const { xr_free(p); }
void deallocate(void* p, size_type n) const { xr_free(p); }
Expand Down
4 changes: 2 additions & 2 deletions src/xrCore/xrMemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ extern XRCORE_API xrMemory Memory;
#ifdef DEBUG_MEMORY_NAME
#include "typeinfo.h"
template <class T>
IC T* xr_alloc(u32 count)
IC T* xr_alloc(size_t count)
{ return (T*)Memory.mem_alloc(count*sizeof(T), typeid(T).name()); }

#else
template <class T>
IC T* xr_alloc(u32 count)
IC T* xr_alloc(size_t count)
{ return (T*)Memory.mem_alloc(count * sizeof(T)); }

#endif
Expand Down

0 comments on commit 06fa47c

Please sign in to comment.