proto_memory_estimations.h 769 B

12345678910111213141516171819202122
  1. // Copyright 2016 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_SYNC_PROTOCOL_PROTO_MEMORY_ESTIMATIONS_H_
  5. #define COMPONENTS_SYNC_PROTOCOL_PROTO_MEMORY_ESTIMATIONS_H_
  6. #include <stddef.h>
  7. namespace sync_pb {
  8. // Estimates memory usage for a proto.
  9. // Needs to be in sync_pb namespace for ADL to find it (when for example
  10. // EstimateMemoryUsage() is called on a list of protos).
  11. // Note: if you get linking errors you need to add explicit instantiation at
  12. // the end of the implementation file.
  13. template <class P>
  14. size_t EstimateMemoryUsage(const P& proto);
  15. } // namespace sync_pb
  16. #endif // COMPONENTS_SYNC_PROTOCOL_PROTO_MEMORY_ESTIMATIONS_H_