source: branches/work_311/util/Memory.h @ 610

Revision 610, 894 bytes checked in by jls17, 5 years ago (diff)
  • moved ARZeroMemory function to Memory.cpp/.h
  • added new ARZeroMemory function which has a size parameter to replace ZeroMemory? (which is only available on windows)
  • replaced all ZeroMemory? calls with ARZeroMemory
  • fixed some gcc compiler warnings
  • now ARQualification throws AppException? instead of exception, because in the standard implementation there is no constructor to pass a message to exception class (this MSVC specific)
Line 
1//Copyright (C) 2014 John Luthgers| jls17
2//
3//This file is part of ARInside.
4//
5//    ARInside is free software: you can redistribute it and/or modify
6//    it under the terms of the GNU General Public License as published by
7//    the Free Software Foundation, version 2 of the License.
8//
9//    ARInside is distributed in the hope that it will be useful,
10//    but WITHOUT ANY WARRANTY; without even the implied warranty of
11//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12//    GNU General Public License for more details.
13//
14//    You should have received a copy of the GNU General Public License
15//    along with ARInside.  If not, see <http://www.gnu.org/licenses/>.
16#pragma once
17
18// template for clearing memory of AR structs
19template<class T>
20void ARZeroMemory(T* obj) { memset(obj, 0, sizeof(T)); }
21
22void ARZeroMemory(void *ptr, size_t size);
Note: See TracBrowser for help on using the repository browser.